<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>

<head>
    <title>学生选课系统</title>
    <style type="text/css">
        body, html {
            margin: 0px;
            padding: 0px;;
        }

        body {
            background-color: #e7e891;
        }

        .text {
            font-style: italic;
            height: 200px;
            text-align: center;
            margin-top: 100px;
            margin-right: 450px;
        }

        .title1 {
            color: #3771BA;
            font-size: 80px;
        }

        .title2 {
            color: #3771BA;
            font-size: 30px;
        }

        .table {
            width: 320px;
            height: 170px;
            padding-top: 30px;
            padding-left: 30px;
            margin-right: 275px;
            background-color: #7DA3D0;
            border: 1px solid #6EABB0;
        }

        #msg {
            color: red;
        }
    </style>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.4.3.js"></script>
    <script>
        function submit() {
            var userName = $("#userName").val();
            var msgSpan = $("#msg");
            console.log("userName" + userName);
            if (userName == "") {
                msgSpan.innerText = "请输入用户名";
                return;
            }
            var password = $("#password").value;
            console.log("password" + password);
            if (password == "") {
                msgSpan.innerText = "请输入密码";
                return;
            }
            $("#loginForm").submit();
        }
    </script>
</head>
<body>
<img src="">

<div class="text">
    <span class="title1">学生选课系统</span><br>
    <span class="title2">Student Curricula-Variable System</span>
</div>

<form id="loginForm" action="/scvs/loginStudent" method="post">
    <table class="table" align="center">
        <tr>
            <td>用户名</td>
            <td><input id="userName" type="text" name="userName"/></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input id="password" type="password" name="password"/></td>
        </tr>
        <tr>
            <td><input type="button" onclick="submit()" value="登录"/></td>
            <td><input type="button" value="注册"/></td>
        </tr>
        <tr>
            <td colspan="2"><span id="msg">${message}</span></td>
        </tr>
    </table>
</form>
</body>
</html>
